package day0212;

public class Test6 {
    public static void main(String[] args) {
        int num=10110101;
        int sum=0;
        for (int i = 0; i < (num+"").length() ; i++) {
            int ele=num/ (int)Math.pow(10,i)%10 * (int)Math.pow(2,i);
            sum= sum + ele;
        }
        System.out.println(sum);
    }
}
